/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.mock.dao.payment;

import java.util.List;

import net.martinimix.dao.payment.PaymentDao;
import net.martinimix.domain.account.Customer;
import net.martinimix.domain.payment.CreditCard;
import net.martinimix.domain.payment.CreditCardTransaction;
import net.martinimix.domain.payment.Payment;
import net.martinimix.domain.payment.PaymentTransaction;

/**
 * Provides a mock payment data access object.
 * 
 * @author Scott Rossillo
 *
 */
public class MockPaymentDao implements PaymentDao {

	private CreditCard creditCard;
	private List creditCards;
	
	/**
	 * Creates a new mock payment dao. 
	 */
	public MockPaymentDao() { }
	
	/* (non-Javadoc)
	 * @see net.martinimix.dao.payment.PaymentDao#getCreditCard(long)
	 */
	public CreditCard getCreditCard(long creditCardId) {
		return creditCard;
	}
	
	/**
	 * Sets the credit card that calls to {@link #getCreditCard(long)} 
	 * will return
	 * 
	 * @param creditCard the <code>CreditCard</code> to be returned
	 * by calls to {@link #getCreditCard(long)}
	 */
	public void setCreditCard(CreditCard creditCard) {
		this.creditCard = creditCard;
	}

	/* (non-Javadoc)
	 * @see net.martinimix.dao.payment.PaymentDao#getCreditCards(long)
	 */
	public List getCreditCards(long customerId) {
		return creditCards;
	}
	
	/**
	 * Sets the credit card list to be returned by calls
	 * to {@link #getCreditCards(long)}.
	 * 
	 * @param creditCards the <code>List</code> of credit
	 * cards to be returned by {@link #getCreditCards(long)}
	 */
	public void setCreditCards(List creditCards) {
		this.creditCards = creditCards;
	}

	/**
	 * This implementation is empty.
	 * 
	 * @see net.martinimix.dao.payment.PaymentDao#saveCreditCard(net.martinimix.domain.account.Customer, net.martinimix.domain.payment.CreditCard)
	 */
	public void saveCreditCard(Customer customer, CreditCard creditCard) { }

	/**
	 * This implementation is empty.
	 * 
	 * @see net.martinimix.dao.payment.PaymentDao#saveCreditCardTransaction(net.martinimix.domain.payment.CreditCardTransaction)
	 */
	public void saveCreditCardTransaction(CreditCardTransaction transaction) { }

	/**
	 * This implementation is empty.
	 * 
	 * @see net.martinimix.dao.payment.PaymentDao#savePayment(net.martinimix.domain.payment.Payment)
	 */
	public void savePayment(Payment payment) { }

	public void savePaymentTransaction(PaymentTransaction transaction) { }

}
